package com.tencreat.domain.im.dto;

import com.tencreat.domain.account.MallUser;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
public class OpenIMCreateGroupDTO {
    // 群成员列表
    List<String> memberUserIDs;
    //群管理员列表
    List<String> adminUserIDs;
    //群主
    String ownerUserID;
    //群信息列表
    OpenIMGroupInfo groupInfo;

    public OpenIMCreateGroupDTO(MallUser user) {
        String ownerUserID = user.getUuid().toString();
        this.ownerUserID = ownerUserID;
//        memberUserIDs = new ArrayList<>();
//        memberUserIDs.add(ownerUserID);
//        adminUserIDs = new ArrayList<>();
//        adminUserIDs.add(ownerUserID);

        OpenIMGroupInfo groupInfo = new OpenIMGroupInfo();
        groupInfo.setGroupID(ownerUserID);
        groupInfo.setGroupName(user.getUsername());
        this.groupInfo = groupInfo;
    }
}
